lesser-know but useful Emacs keybindings
Table of Contents
Main
Transpose
C-t: from ba to abM-t: transpose wordsC-x C-t: line transpose
word manipulation
M-c: Capitalize Word.M-u: UPPERCASE WORD.M-l: lowercase word.
navigation
M-m: move to first non-whitespace character on line.M-{/}: move by paragraphC-M-f/b: (forward/backward over balanced expressions.)C-M-u/d: (Move up/down in (parentheses hierarchy))C-M-a/e: beginning/end of functionint main() { // this is crazy }
C-x r SPC <REGISTER>: mark the place with a register.C-x r j <REGISER>: jump to target registerC-M-l: try to show you all the block where you cursor is.
editing
C-M-k: (kill balanced expression) ()("exp1" "exp2" (exp3))
C-M-@: (mark balanced expression)("this is a balanced expression")
M-@: Mark word word word wordM-h: mark paragraphC-M-h: Mark functionM-^: join linesxen delete indentationC-o: open line (insert newline without moving cursor)M-\: remove the duplicate space to no spaceM-SPC: remove duplicate space to oneM-z: zap to target character to here Z good.C-x TAB: indent rigidly.C-x C-o: delete blank lines
Windows & Buffers
C-x 4 f: Find file in other windowC-x 5 f: Find file in new frameC-x r j: Jump to registerC-x r w: Window configuration to register
others
C-u C-@: Pop mark ringC-x C-@: Pop global mark ringC-x z: repeat last command, press z to continue- expand-region packages will help a lot.